#ifndef UDP_H
#define UDP_H



#define SERVER_PORT    4000
#define MAX_LEN_ONCE   32
#define TCP_PORT       5000

#ifndef MAXSAT
#define MAXSAT 32
#endif
// diff correction struct
#pragma pack(1)
typedef struct {        /* raw data */
	double tow;	// GPS time of the week in second
	unsigned char numGps;
	unsigned char numBds;
	unsigned char numGln;
	unsigned char system[MAXSAT];	// system, 0, 1, 2 GPS, BDS & GLN
	unsigned char PRN[MAXSAT];	// PRN number
	double dDO[MAXSAT];	// Doppler in Hz
	double dPR[MAXSAT];	// pseudorange in meter
} diff_t;
#pragma pack()

int PrintDiff(diff_t *diff);

int UdpRoverInit(char *server_ip);
int UdpRoverRecieve(diff_t *diff);
//int UdpRoverRequest(unsigned char *request_data);

int UdpStationInit(char *server_ip);
int UdpStationSend(diff_t *diff);

int UdpServerInit();
int UdpServerLoop(diff_t *diff, int arg);

int PrintDiff(diff_t *diff);

int UdpClose(int sock_fd);




#endif